USE [vudu]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[InsertarRolUniversidad]

	@correo Varchar(50),
	@clave Varchar(50),
	@id_uni int
AS
BEGIN

	SET NOCOUNT ON;

	INSERT INTO [dbo].[ROL]
	(correo, pass,tipo_rol)
	VALUES(@correo, @clave,'Universidad');
	update Universidad Set estadoRol = 'Activo' ,fk_rol=(Select MAX(id_rol) from rol )
	where id_Universidad = @id_uni;
END
GO